<?php

class DB_LOCATION extends ORM_Table {
    
    static protected $table_name = 'location';
    
    static public function getTableName($params = null) {
        return self::$table_name;
    }
    
    static function saveLocation($weibo_id, $loc, $nums){
        $location    = ORM_Finder::findOne('DB_LOCATION', array('weibo_id'=>$weibo_id, 'location'=>$loc));
        if(!$location){
            $location    = new DB_LOCATION();
        }
        $location->setWeiboId($weibo_id);
        $location->setLocation($loc);
        $location->setNums($nums);
        $location->save();        
    }
}

?>
